<#if errors??>
	<#list errors as error>
		 ${error.category} - ${error.message}<br />
	</#list>
</#if>

<form action="<%= path %>" method="post">
  
  <#if <%= "#{model_parameter_name}.id" %>??>
    <input type="hidden" name="<%= "#{model_parameter_name}.id" %>" value="<%= "${#{model_parameter_name}.id}" %>"/>
    <input type="hidden" name="_method" value="put"/>
  </#if>

<% @attributes.each do |att| -%>
  <div class="field">
    <%= att.html_label %>:<br />
		<%- if att.type.eql?("references") -%>
    <select name="<%= model_parameter_name %>.<%=att.name%>.id">
	  	<#list <%=att.name%>List as <%=att.name%>>
				<option value="${<%=att.name%>.id}" <#if <%= model_parameter_name %>.<%=att.name%>?? && <%= model_parameter_name %>.<%=att.name%>.id <%= "== #{att.name}"%>.id>selected="true"</#if> >${<%=att.name%>.id}</option>
	  	</#list>
    </select>
		<%- else -%>	
    <%= "<@html.#{att.html_input} \"#{model_parameter_name}.#{att.name}\" #{model_parameter_name}.#{att.name}/>"  %>
		<%- end -%>
  </div>
<% end -%>
  <div class="actions">
    <button type="submit">send</button>
  </div>
</form>

<a href="<%= path %>">Back</a>

